#include "Utils.h"

namespace Utils
{
	std::string*	explode(std::string s, unsigned int length, char sep)
	{
		std::string*	w = new std::string[length + 1];
		unsigned int	i = 0, j = 0;

		for (unsigned int k = 0; k < length + 1; ++k)
			w[k] = "";
		while (i < length && i < s.length())
		{
			if (s[i] != sep && s[i] != '\0')
				w[j] += s[i];
			if ((s[i] == sep || s[i] == '\0') && w[j] != "")
				++j;
			++i;
		}
		return (w);
	}

	std::string		intToString(int n)
	{
		std::ostringstream oss;

		oss << n;
		return (oss.str());
	}
}
